Skip to content

fix: use file icon for LICENSE files#2563

Closed
gioboa wants to merge 1 commit intonpmx-dev:mainfrom
gioboa:fix/2558
Closed

fix: use file icon for LICENSE files#2563
gioboa wants to merge 1 commit intonpmx-dev:mainfrom
gioboa:fix/2558

Conversation

@gioboa
Copy link
Copy Markdown

@gioboa gioboa commented Apr 18, 2026

🔗 Linked issue

Close #2558

📚 Description

Use file icon for LICENSE files.

Before:

Screenshot 2026-04-18 at 15 15 08

After:

Screenshot 2026-04-18 at 15 14 15

Before creating the pull request, please make sure you do the following:

  • Check that there isn't already a PR that solves the problem the same way. If you find a duplicate, please help us reviewing it.
  • Ensure that PR title follows conventional commits (https://www.conventionalcommits.org)
  • Update the corresponding documentation if needed.
  • Include relevant tests that fail without this PR but pass with it.
  • Add any additional context, tradeoffs, follow-ups, or things reviewers should be aware of.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 18, 2026 1:19pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Apr 18, 2026 1:19pm
npmx-lunaria Ignored Ignored Apr 18, 2026 1:19pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Style

    • Updated the visual icon displayed for LICENSE files to use the standard default file icon.
  • Tests

    • Added test coverage for LICENSE file icon mappings.

Walkthrough

The icon mapping for the LICENSE family of filenames (including LICENSE, LICENSE.md, LICENSE.txt, and their lowercase variants) is updated from vscode-icons-file-type-license to vscode-icons-default-file. Test coverage is expanded to validate these mappings.

Changes

Cohort / File(s) Summary
Icon mapping updates
app/utils/file-icons.ts
Updated FILENAME_ICONS entries for LICENSE files (LICENSE, LICENSE.md, LICENSE.txt, and lowercase variants) to use the default file icon instead of the specialised license icon.
Test coverage expansion
test/unit/app/utils/file-icons.spec.ts
Added test assertions for exact-filename matching of LICENSE files across common casing and extension combinations, verifying all variants resolve to vscode-icons-default-file.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: use file icon for LICENSE files' clearly and concisely describes the main change in the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the icon change for LICENSE files with before/after screenshots.
Linked Issues check ✅ Passed The PR successfully addresses the requirement in #2558 by implementing file icon display for extensionless LICENSE files and variants with extensions.
Out of Scope Changes check ✅ Passed All changes are scoped to the requirements in #2558: updating LICENSE file icon mappings and corresponding unit tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/utils/file-icons.ts`:
- Around line 267-272: The FILENAME_ICONS mapping currently forces all LICENSE
variants to the generic icon; change it to only override extensionless LICENSE
names so extension-based fallbacks still apply: remove the keys 'LICENSE.md',
'LICENSE.txt', 'license.md', and 'license.txt' from the mapping in
app/utils/file-icons.ts (leave 'LICENSE' and 'license' if you want to target
only extensionless files), so getFileIcon's extension-based logic will return
markdown/text icons for .md/.txt files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 53cb6251-b574-440a-bb23-eb800880cce9

📥 Commits

Reviewing files that changed from the base of the PR and between d9f8d56 and 64afe72.

📒 Files selected for processing (2)
  • app/utils/file-icons.ts
  • test/unit/app/utils/file-icons.spec.ts

Comment thread app/utils/file-icons.ts
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@connorshea
Copy link
Copy Markdown

I don't think this is actually implementing the issue as-intended?

Copy link
Copy Markdown
Author

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to show a file icon for it?

Based on this description, I implemented it. Let me know if it's a different thing @nicolo-ribaudo

Copy link
Copy Markdown
Contributor

@ghostdevv ghostdevv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, thank you for the PR! unfortunately, I think the issue was that the icon isn't showing up not that it should use the default file type. I had a look into why it's not showing up but haven't figured it out yet. Will close this for now and post my findings in the original issue 🙏

@ghostdevv ghostdevv closed this Apr 19, 2026
@gioboa gioboa deleted the fix/2558 branch April 20, 2026 07:00
@gioboa
Copy link
Copy Markdown
Author

gioboa commented Apr 20, 2026

Thanks @ghostdevv for your review 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File tree LICENSE icon doesn't render

3 participants